import request from '@/config/axios'

// EHS培训记录 VO
export interface TrainRecordVO {
  id: number // 记录id
  teacherType: number // 讲师类型
  teacherId: number // 培训人id
  teacherName: string // 培训人
  content: string // 培训内容
  trainNum: number // 培训人数
  trainPics: string // 培训照片（多张图用逗号隔开）
  trainScopeId: string // 培训范围id(区域或者餐厅)
  trainScopeName: string // 培训范围名称(区域或者餐厅名称)
}

// EHS培训记录 API
export const TrainRecordApi = {
  // 查询EHS培训记录分页
  getTrainRecordPage: async (params: any) => {
    return await request.get({ url: `/ehs/train-record/page`, params })
  },

  // 查询EHS培训记录详情
  getTrainRecord: async (id: number) => {
    return await request.get({ url: `/ehs/train-record/get?id=` + id })
  },

  // 新增EHS培训记录
  createTrainRecord: async (data: TrainRecordVO) => {
    return await request.post({ url: `/ehs/train-record/create`, data })
  },

  // 修改EHS培训记录
  updateTrainRecord: async (data: TrainRecordVO) => {
    return await request.put({ url: `/ehs/train-record/update`, data })
  },

  // 删除EHS培训记录
  deleteTrainRecord: async (id: number) => {
    return await request.delete({ url: `/ehs/train-record/delete?id=` + id })
  },

  // 导出EHS培训记录 Excel
  exportTrainRecord: async (params) => {
    return await request.download({ url: `/ehs/train-record/export-excel`, params })
  },
  // 获取用户精简信息列表
  listSimpleUsers:async (params) =>{
  return await request.get({ url: `/system/user/list-all-simple`, params })
  },
  // 获取部门精简信息列表
  listSimpleDepts:async () => {
    return await request.get({ url: `/system/dept/list-all-simple` })
  }

}
